<html>
<head>
<title>sqlinjectiontest</title>
<meta http-equiv="Content-Type" content="text/html charset=utf-8"/>
<script type='text/javascript' src='jquery-2.2.0.js'></script>
<script language='javascript' type='text/javascript'>
<!--
	function loginyanzheng()
	{
		var flag=false;
		if($('#username').val()=="")
		{
			$('#show').val("用户名不能为空");
			flag=true;
		}
		else
		{
			$('#show').val("");
		}
		if($('#userpass').val()=="")
		{
			$('#show1').val("密码不能为空");
			flag=true;
		}
		else
		{
			$('#show1').val("");
		}
		if(flag)
		{
			return;
		}
		$.post('yanzhengselectpwd.php',{"username":$('#username').val(),"userpass":$('#userpass').val()},function(data,status)
		{
			if(data=="true")
			{
				location.href='ok.html';
			}
			else
			{
				$('#show2').text("对不起,用户名或密码错误请重新输入！！");
			}
		});
	}
//>
</script>
</head>
<body>
<h1>登录页面</h1>
<?php
	header("content-type:text/html;charset=utf-8");
?>
<form>
用户名：<input type='text' name='name' id='username'/><input type="text" id="show" style="border-width:0;color:red"/><br/>
密&nbsp&nbsp码：<input type='password' name='pwd' id='userpass'/><input type="text" id="show1" style="border-width:0;color:red"/><br/>
<input type='button' value='提交' onclick="loginyanzheng()"/><input type='reset' value='重置'/><br/>
<label id='show2' style="border-width:0;color:red"></label>
</form>
</body>
</html>